Current Location: Home> Function Categories> atan2

atan2

Arctangle of two parameters
Name:atan2
Category:math
Programming Language:php
One-line Description:Arctangent of two parameters.

Definition and usage

atan2() function returns the arctangent of two parameters, with the return value being radians, whose value is between -PI and PI (including -PI and PI).

Example

This example calculates the arctangent value of different variables x and y:

 <?php
echo ( atan2 ( 0.50 , 0.50 ) ) ;
echo ( atan2 ( - 0.50 , - 0.50 ) ) ;
echo ( atan2 ( 5 , 5 ) ) ;
echo ( atan2 ( 10 , 20 ) ) ;
echo ( atan2 ( - 5 , - 5 ) ) ;
echo ( atan2 ( - 10 , 10 ) )
?>

Try it yourself

grammar

 atan2( x , y )
parameter describe
x Required. A number.
y Required. A number.

illustrate

atan2() function calculates the arctangent value of two variables x and y . Similar to calculating the arctangent tangent of y/x, the difference is that the symbol of the two parameters is used to determine the result outside the quadrant.

Similar Functions
Popular Articles